how nested setTimeout method gets executed in sequence